<?php
require_once "phpfastcache_v1.3_stable/php_fast_cache.php";
$cache = new phpFastCache();

$cache->storage = "files";
$cache->path = realpath(dirname(__FILE__)) .'/testcache/';



$content = $cache->get("cache_content");

if($content == null) {
    // for testing
    echo "This is not caching, page is render with lot queires and slow speed <br>";
    // do what you want, like get content from cURL | API | mySQL Query and return result to $content
    $content = file_get_contents("http://www.phpfastcache.com/testing.php");

    // rewrite cache for other request in 35 seconds
    $cache->set("cache_content",$content,35);
} else {
    // use cache
    // node
    echo "THIS TIME USE CACHE, FAST! <br>";
}

echo "TRY F5 to refesh the page to see new SPEED with Cache!<br>";
echo $content;

